'use strict';

const Controller = require('egg').Controller;

class ControllerGetCourseController extends Controller {
    async controllerGetCourse() {
        const { ctx } = this;
        const data = {
            username: ctx.request.body.username,
        };
        const res = await this.ctx.service.serviceGetCourse.postGetCourseData(data);
        if (res.code === 1) {
            ctx.status = 200;
            ctx.body = {
                data: res.data,
            };
        } else {
            ctx.status = 400;
            ctx.body = { message: res.message };
        }

    }
}

module.exports = ControllerGetCourseController;
